home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Zine 9
/
Zine - Issue 09 (1991-06)(Brainstorm).adf
/
sources
/
stc_normal.s
< prev
next >
Wrap
Text File
|
2022-11-05
|
3KB
|
150 lines
;
;decruncher v1.4
; for
;Stone Cracker v2.6a/v2.70/v2.71
;
;(c) 1990 Mr.Spiv of Cave
;
;
st: movem.l d0-d7/a0-a6,-(sp)
colour: lea $dff006,a6
moveq #0,d7
moveq #0,d6
moveq #0,d5
move.b 3+data(pc),d7 ;sijoita bittiteho
move.b 16+data(pc),d5 ;sijoita scanteho
move.b 17+data(pc),d6 ;sijoita normteho
lea 18+data(pc),a0
add.l 12+data(pc),a0 ;crunched lenght (pass3)
move.l 2+workend(pc),a1 ;
move.l a1,a2
sub.l 4+data(pc),a2 ;sub pass2 crunched lenght
lea getnew(pc),a5
lea rorit(pc),a4
move.l -(a0),d0
decrunchloop: moveq #0,d1
add.l d0,d0
bne.s no_ovl1
jsr (a5)
no_ovl1: bcc.L header_0
add.l d0,d0
bne.s no_ovl2
jsr (a5)
no_ovl2: bcs.s header_1xx
moveq #8-1,d3 ;header 10
moveq #2-1,d4
bra.s header_110
header_1xx: addx.w d1,d1
add.l d0,d0
bne.s no_ovl3
jsr (a5)
no_ovl3: addx.w d1,d1 ;
moveq #9-1,d3
moveq #3-1,d4
cmp.w #2,d1
beq.s header_110
moveq #10-1,d3 ;header 1+11
addq.w #1,d4
header_110: jsr (a4)
copyloop: move.b -1(a1,d2.w),-(a1)
dbf d4,copyloop
continue: cmp.l a1,a2
blo.s decrunchloop
workstart: lea $30000,a0 ;
workend: lea $50000,a2 ;
move.l a0,a3
move.b 0+data(pc),d0 ;get pass2 values
move.b 1+data(pc),d1 ;
move.b 2+data(pc),d2 ;
add.l 8+data(pc),a3 ;uncrunched lenght
byteback: moveq #0,d7
move.b (a1)+,d4
cmp.b d0,d4
beq.s byte1
cmp.b d1,d4
beq.s byte2
test2: move.b d4,(a0)+
bra.s test
byte1: move.b (a1)+,d5
beq.s test2
move.b (a1)+,d4
bra.s repeat
byte2: move.b (a1)+,d5
beq.s test2
move.b d2,d4
repeat: move.b d5,d7
addq.w #2-1,d7
repeatloop: move.b d4,(a0)+
dbf d7,repeatloop
test: move.w (a6),$17a(a6)
cmp.l a3,a0
blo.s byteback
clsrest: cmp.l a2,a0 ;bra.s run ;if no clearing
bhs.s run
move.w (a6),$17a(a6)
clr.b (a0)+
bra.s clsrest
run: movem.l (sp)+,d0-d7/a0-a6
jump: jmp $30000
dc.b "-StoneCracker by Mr. Spiv of CAVE-"
header_0: add.l d0,d0
bne.s no_ovl5
jsr (a5)
no_ovl5: bcc.s header_00
addx.w d1,d1
add.l d0,d0
bne.s no_ovl6
jsr (a5)
no_ovl6: addx.w d1,d1
cmp.w #2,d1
beq.s normaldata
move.w d5,d3 ;scan teho
jsr (a4)
move.w d2,d4
addq.w #5-1,d4
bittikpl: move.w d7,d3 ;bitti teho
bra.L header_110
normaldata: move.w d6,d3 ;norm teho
jsr (a4)
addq.w #8-1,d2
move.w d2,d4
bra.s getbytes
header_00: moveq #3-1,d3
jsr (a4)
move.w d2,d4
subq.w #1,d4
and.w #$0007,d4
getbytes: moveq #8-1,d3
jsr (a4)
move.b d2,-(a1)
dbf d4,getbytes
bra.L continue
getnew: move.l -(a0),d0 ;jsr (a5)
move.w (a6),$17a(a6)
move.w #$0010,ccr
addx.l d0,d0
rts
rorit: moveq #0,d2 ;jsr (a4)
rorloop: add.l d0,d0
bne.s no_ovl7
jsr (a5)
no_ovl7: addx.w d2,d2
dbf d3,rorloop
rts
;---------------------------------------------------------
data: